
#include <stdlib.h>
#define BLOCK_SIZE (1<<6)
#define ALLOC_SIZE (1<<20)

int read1M(register int * ptr, int blocks, register int block_size, int vias){
	register size_t i;
	register size_t j;
	register int l,r;
	register size_t lazo;
	
//inicialización
	for (i=0; i < blocks+blocks/vias; i++)
		l=*(ptr+i*block_size/sizeof(int));
//test	
	for (i=0; i < blocks; i++)
MAGIC:		l=*(ptr+i*block_size/sizeof(int));

	return l; //cheat scope
}

int main(int argc, char *argv[]){
	int * ptr;
//blocks y vías vienen en potencias de 2: 
	int blocks;
	int block_size;
	int vias;

//Puede que alguien encuentre una forma mas elegante, yo no.
	block_size=atoi(argv[1]);
	blocks=(1<<atoi(argv[2]));
	vias=(1<<atoi(argv[3]));

	ptr = malloc(block_size*blocks);
	if (ptr==NULL) return 1;
	read1M(ptr,blocks,block_size,vias);
	free(ptr);
	return 0;
}
